<?php
//require_once 'DisplayInterface.php';
class XmlDisplay implements DisplayInterface {
    public function display($data)
    {

        return $this->initData($data);
    }

    public function initData($data, $keyValue = "xml")
    {
        $html = "<{$keyValue}>";
        if (is_array($data))
        {
            foreach ($data as $key => $value)
            {
                $html .= $this->initData($value, $key);
            }
        } else {
            $html .= $data;
        }
        $html .= "</{$keyValue}>";
        return $html;
    }
}